Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration Test for Hash commands #36

Merged

Conversation

anishkoulgi
Copy link
Contributor

Summary

Fixes #31
Here, we add the testcontainers-go package to run integrations tests with a running dice server. All the commands are executed in the dice container. The container is shared by all commands tests and cleaned up after all the tests have finished running.
Tests for following commands have been added in internal/tests/integration/commands:

  • HGET
  • HSET
  • HGETALL

Note

As of creating this PR, the dicedb/dicedb:latest image does not have the HINCRBY and HMGET commands implemented. Hence, the tests for these commands have not been added in this PR. We will create a separate issue for these commands.

@lucifercr07
Copy link
Contributor

@anishkoulgi please fix lint issue

@anishkoulgi anishkoulgi force-pushed the feat/hash-commands-integration-tests branch from 7fac486 to 98f18f0 Compare October 9, 2024 08:25
@anishkoulgi
Copy link
Contributor Author

@lucifercr07 fixed the lint issue.

Copy link
Contributor

@lucifercr07 lucifercr07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @anishkoulgi thanks for contributing. Minor comments.

internal/tests/integration/commands/hset_test.go Outdated Show resolved Hide resolved
Added testcases for testing:
- Set simple key value pairs in the hash.
- Update one key and set a new key.
- Pass invalid number of arguments.
- Pass invalid key.
Added testcases for testing:
-  HGET with a non-existent key.
- HGET with a valid field in the key.
- HGET with an invalid field in the key.
- HGET with an invalid key.
Added testcases for testing:
- HGETALL with a non-existent key.
- HGETALL with a valid key.
- HGETALL with an invalid key.
@anishkoulgi anishkoulgi force-pushed the feat/hash-commands-integration-tests branch from 98f18f0 to e8f54fe Compare October 9, 2024 11:43
@anishkoulgi
Copy link
Contributor Author

@lucifercr07 addressed the comment.

@lucifercr07 lucifercr07 merged commit cea7ede into DiceDB:master Oct 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add integration tests for commands execution for hashes datastructure
2 participants